# 今天是第几天
import datetime
year,month,day=map(int,input().split("/"))
tar=datetime.date(year,month,day)
day_count=tar-datetime.date(tar.year-1,12,31)
print(f"{year}年{month}月{day}日是{year}年第{day_count.days}天")